package demo02;

public class Demo02StringGet {
    public static void main(String[] args) {
        int length = "asdahfiahdfjahfudi".length();
        System.out.println("字符串的长度为"+length);

        //拼接字符串
        String str1="Hello";
        String str2="World";
        String str3=str1.concat(str2);
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);

        //获取指定位置的单个字符
        String str4="abcdefghijklmn";
        System.out.println(str4.charAt(5));

        //查找字符串出现的索引位置(0开始)
        String str5="abcdabcdabfabd";
        System.out.println(str5.indexOf("c"));
    }
}
